﻿@model AdventureWorks.Entities.Customer

@{
	ViewBag.Title = String.Format("[ {0} ]", Model.FullName);
}

<h2>Details of @Model.FullName</h2>

<fieldset>
    <legend>Customer</legend>

    <div class="display-label">Name</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.FullName)
    </div>

    <div class="display-label">Company Name</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.CompanyName)
    </div>

    <div class="display-label">Sales Person</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.SalesPerson)
    </div>

    <div class="display-label">Email</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.EmailAddress)
    </div>

    <div class="display-label">Phone</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Phone)
    </div>

    <div class="display-label">Modified Date</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.ModifiedDate)
    </div>
	<br />
	@if (Model.Addresses.Count > 0)
 {
	<fieldset>
		<legend>Addresses</legend>
		<p>@Html.ActionLink("New Address", "../Address/Create", new { CustomerID = Model.ID }) - 
		@Html.ActionLink("Manage Addresses", "../Address/Index", new { CustomerID = Model.ID })</p>
		@foreach (var address in Model.Addresses)
  {
				@Html.Partial("_DetailAddresses", address)
  }
	</fieldset>
 }
</fieldset>
<p>
    @Html.ActionLink("Edit", "Edit", new { id=Model.ID }) |
	@Html.ActionLink("Back to List", "Index")
</p>
